package com.focusai.efairy.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.focusai.efairy.EFApplication;
import com.focusai.efairy.R;
import com.focusai.efairy.ui.activity.global.CharaterActivity;
import com.focusai.efairy.ui.activity.global.UserProtocolActivity;
import com.focusai.efairy.ui.base.SwipeBackBaseActivity;

/**
 * Created by luo_guangwen on 2017/8/7.
 */

public class AboutActivity extends SwipeBackBaseActivity implements View.OnClickListener {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_about);
        initView();
    }

    @Override
    public void initTitte() {
        setCenterTitleName(R.string.about);
    }

    @Override
    protected void initView() {
        findView(R.id.ll_welcome).setOnClickListener(this);
        findView(R.id.ll_character).setOnClickListener(this);
        findView(R.id.ll_service).setOnClickListener(this);
        findView(R.id.ll_feedback).setOnClickListener(this);
        ImageView appLog = findView(R.id.iv_app_icon);
        if (EFApplication.isCciotApp()){
            appLog.setImageResource(R.drawable.app_icon_cciot);
        }
    }

    @Override
    public void onClick(View v) {
        Intent intent;
        switch (v.getId()) {
            case R.id.ll_welcome:
                intent = new Intent(getContext(), FunctionWizardActivity.class);
                intent.putExtra(FunctionWizardActivity.KEY_NO_START, false);
                startActivity(intent);
                break;
            case R.id.ll_character:
                intent = new Intent(getContext(), CharaterActivity.class);
                startActivity(intent);
                break;
            case R.id.ll_service:
                intent = new Intent(getContext(), UserProtocolActivity.class);
                startActivity(intent);
                break;
            case R.id.ll_feedback:
                intent = new Intent(getContext(), FeedbackActivity.class);
                startActivity(intent);
                break;
            default:
                break;
        }
    }
}
